You are here: Symbol Reference > Dew Namespace > Dew.Stats Namespace > Dew.Stats.Units Namespace > Classes > Statistics Class > Statistics Methods > BetaFit Method > Statistics.BetaFit Method ([In] TVec, out double, out double, double[], double[], int, double, double)
Dew Stats for .NET
ContentsIndexHome
PreviousUpNext
Statistics.BetaFit Method ([In] TVec, out double, out double, double[], double[], int, double, double)

Calculate parameters for Beta distributed values.

Syntax
C#
Visual Basic
public static void BetaFit([In] TVec X, out double A, out double B, ref double[] PCIA, ref double[] PCIB, int MaxIter, double Tolerance, double Alpha);
Parameters 
Description 
[In] TVec X 
Stores data which is assumed to be Beta distributed. 
out double A 
Return Beta distribution parameter estimator a. 
out double B 
Return Beta distribution parameter estimator b. 
ref double[] PCIA 
a (1-Alpha)*100 percent confidence interval. 
ref double[] PCIB 
b (1-Alpha)*100 percent confidence interval. 
int MaxIter 
Maximum number of iterations needed for deriving a and b. 
double Tolerance 
Defines the acceptable tolerance for calculating a and b. 
double Alpha 
Confidence interval percentage. 

RandomBeta, BetaStat

The following example generates 100 random Beta distributed values and then uses BetaFit routine to extract used a and b parameters:

using Dew.Math; using Dew.Stats; using Dew.Stats.Units; namespace Dew.Examples; { private void Example() { Vector v = new Vector(1000, false); // first, generate 1000 randomly beta distributed // numbers with parameters a = 3 and b = 2 Random rnd = new Random(); StatRandom.RandomBeta(3.0, 2.0, v, rnd.Next()); double esta, estb; double[] cia = new double[2]; double[] cib = new double[2]; // Now extract the a,b and their 95% confidence intervals. //Use at max 300 iterations and tolerance 0.001 Statistics.BetaFit(v, out esta, out estb, ref cia, ref cib, 300, 1.0e-3, 0.05);
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!